package com.ericsson.resourceplanner.dao.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import java.util.*;


@Entity
@NamedQueries({
    @NamedQuery(name="EmpDetails.findAll",
                query="SELECT e FROM EmpDetails e") 
               
    
    }) 

@Table(name ="EMPLOYEE")
public class EmpDetails implements Serializable{
	private static final long serialverionUID = 1L;
	
	@Id
	@Column(name="ID")
	private String iD;
	
	/*public List<EmployeeRole> getEmployeeRoles() {
		return employeeRoles;
	}

	public void setEmployeeRoles(List<EmployeeRole> employeeRoles) {
		this.employeeRoles = employeeRoles;
	}*/

	@Column(name="SIGNUM_ID")
	private String signum_id;
	
	public Set<EmployeeRole> getEmployeeRoles() {
		return employeeRoles;
	}

	public void setEmployeeRoles(Set<EmployeeRole> employeeRoles) {
		this.employeeRoles = employeeRoles;
	}

	@Column(name="PASSWORD")
	private String password;
	
	public String getiD() {
		return iD;
	}

	public void setiD(String iD) {
		this.iD = iD;
	}

	public String getSignum_id() {
		return signum_id;
	}

	public void setSignum_id(String signum_id) {
		this.signum_id = signum_id;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmp_name() {
		return emp_name;
	}

	public void setEmp_name(String emp_name) {
		this.emp_name = emp_name;
	}

	public static long getSerialverionuid() {
		return serialverionUID;
	}

	@Column(name="EMP_NAME")
	private String emp_name;
	

    /*@JoinTable(
	        name="EMPLOYEE_ROLE",
	        joinColumns=
	            @JoinColumn(name="EMPLOYEE_ID", referencedColumnName="iD"),
	        inverseJoinColumns=
	            @JoinColumn(name="ROLE_ID", referencedColumnName="id")
	    )
	@OneToMany(fetch=FetchType.EAGER)
	Set<Role> rolelist;

	public Set<Role> getRolelist() {
		return rolelist;
	}

	public void setRolelist(Set<Role> rolelist) {
		this.rolelist = rolelist;
	}*/
	
	@OneToMany(mappedBy="employee",fetch=FetchType.EAGER,cascade = CascadeType.ALL)
	private Set<EmployeeRole> employeeRoles;
	
	

}
